package com.ztewatch.wearcontacts.dialpad;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.ztewatch.wearcontacts.R;
import com.ztewatch.wearcontacts.WearContactEditActivity;

public class DialpadActivity extends Activity implements OnClickListener{
	private DialpadFragment mDialpadFragment;
	private Button cancel_btn;
	private Button ok_btn;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_dialpad);
		mDialpadFragment = new DialpadFragment();
		getFragmentManager().beginTransaction()
				.replace(R.id.layout_dial, mDialpadFragment).commit();
		initBtn();
	}
	
	private void initBtn() {
		cancel_btn = (Button)findViewById(R.id.dialpad_cancel_btn);
		ok_btn = (Button)findViewById(R.id.dialpad_ok_btn);
		cancel_btn.setOnClickListener(this);
		ok_btn.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.dialpad_cancel_btn:
			onBackPressed();
			break;
		case R.id.dialpad_ok_btn:
			Intent intent = new Intent();
			intent.setClass(this, WearContactEditActivity.class);
			startActivity(intent);
			break;
		default:
			break;
		}
	}
}
